<?php
class Sms{
    public function Send($mobile,$content,$smstype='',$name) {
        switch ($smstype) {
            case 'register':
                $appname='网演中国';
                $appcode='SMS_27665137';
                $smstpl="{\"code\":\"".$content."\",\"name\":\"网演\"}";
                break;
			case 'loginbysms':
                $appname='网演中国';
                $appcode='SMS_27780060';
                $smstpl="{\"code\":\"".$content."\",\"product\":\"网演\"}";
                break;
			case 'findpassword':
                $appname='网演中国';
                $appcode='SMS_27675100';
                $smstpl="{\"code\":\"".$content."\",\"product\":\"网演\"}";
                break;
			case 'mobilecheck':
                $appname='网演中国';
                $appcode='SMS_59705150';
                $smstpl="{\"code\":\"".$content."\",\"product\":\"网演\"}";
                break;
			case 'mobilechange':
                $appname='网演中国';
                $appcode='SMS_27570167';
                $smstpl="{\"code\":\"".$content."\",\"product\":\"网演\"}";
                break;
			case 'placeorder'://下单
                $appname='网演中国';
                $appcode='SMS_69735237';
                $smstpl="{\"name\":\"".$name."\",\"content\":\"".$content."\"}";
                break;
            default:
                $appname='注册验证';
                $appcode='SMS_27665137';
                $smstpl="{\"code\":\"".$content."\",\"name\":\"网演\"}";
                break;
        }
        spl_autoload_unregister(array('Base', 'autoload'));
        include '../plugin/alidayu/TopSdk.php';
        $c = new TopClient;
        $c->appkey = '23432887';
        $c->secretKey = '5f98b37f2809f2fbebdca4d14cd04572';
        $c->format='json';
        $req = new AlibabaAliqinFcSmsNumSendRequest;
        $req->setExtend("123456");
        $req->setSmsType("normal");
        $req->setSmsFreeSignName($appname);
        $req->setSmsParam($smstpl);
        $req->setRecNum($mobile);
        $req->setSmsTemplateCode($appcode);
        $result=$c->execute($req);
  		return $result;
    }   
}
?>